<?
	include("../model/database.php");
	include("../model/xl_dia_diem.php");
	include("../model/xl_binh_luan_dia_diem.php");
	include("../model/xl_hinh_anh_dia_diem.php");
	
	$xl_dia_diem=new xl_dia_diem();
	$xl_binh_luan_dia_diem=new xl_binh_luan_dia_diem();
	$xl_hinh_anh_dia_diem=new xl_hinh_anh_dia_diem();


	$id_user = $_POST['usid'];
	$lastid_create = $_POST['lastid_create'];
	
	
	
	$arrDDNext = $xl_dia_diem->danhSachDiaDiemTheoMaNguoiDung_ViewMore($id_user,$lastid_create);

	$l = count($arrDDNext);
	$l_p = $arrDDNext[$l-1];
	$id_l = $l_p['MaDiaDiem'];?>
    
			 <tbody>	
	<?			
            	foreach($arrDDNext as $row)
				{
					$image = $xl_hinh_anh_dia_diem->hinhAnhDiaDiem($row['MaDiaDiem']);
					$hinhdaidien = $image[0]['DuongDan'];
					$sobinhluan = $xl_binh_luan_dia_diem->tong_binh_luan($row['MaDiaDiem']);
				?>
            	<tr class="" fav-id="fav-86">
                    <td class="image">
                    <div class="holder">
                        <a href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>">
                            <img src="uploads/place/<? if($hinhdaidien==""){?>photo_not_available.png<? }else{ ?><?=$hinhdaidien?><? }?>" alt="<?=$row['TenDiaDiem']?>">
                        </a>
                    </div>
                    </td>
                    <td class="favorite-info">
                    	<a class="name" href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>"><?=$row['TenDiaDiem']?></a>
                        <ul class="favorite-place-rating">
                        	<div class="rating rate_40" title="4.17 điểm / 6 lượt đánh giá"></div>
                        </ul>
                        <ul class="other-favorite-info"> <?=$row['DiaChi']?> - <?=$row['TenQuanHuyen']?> - <?=$row['TenTinhThanh']?> </ul>
                    </td>
                    <td class="comments"><?=$sobinhluan?></td>
                    <td class="visits"><?=$row['SoLuotXem']?></td>
                </tr>
                <?
				}
				if($l>=10)
				{
                ?>
                </tr>
                <tr id="trMoreCreatePlace">
                <td colspan="5">
                <input type="hidden" id="usid" name="usid" value="<?=$id_user?>" />
                <input type="hidden" id="lastid_create" name="lastid_create" value="<?=$id_l?>" />
                <a id="moreCreatePlace" class="more" >xem thêm</a>
                </td>
       		 </tr>
             <?
			  }
			 ?>
			 </tbody>